import axios from 'axios'
import {
  get,
  post
} from '@/utils/request'

/**
 * 接口授权
 * @param {Object} data 授权参数信息
 */
export const authorize = data => post('/authorize', data, true)

/**
 * 账号密码登录接口
 * @param {*} data
 */
export const wechatAuthorize = function (data) {
  return post('/authorize/wechat', data, true)
}

/**
 * 账号密码登录接口
 * @param {*} data
 */
export const wechatUserInfo = function (data) {
  return get('/user/wechat', data, true)
}

/**
 * 图片上传接口
 * @param {*} data
 */
export const uploadFile = function (data) {
  return post('/attachs/upload', data, true)
}

/**
 * 发送短信验证码接口
 * @param {*} data
 */
export const sendSmsCode = function (data) {
  return axios.post('/sms/captcha', data)
}
